package com.cn.serverline.lineicp.productionLine.enums;

import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
import lombok.Getter;

/**
 * 工人技术等级枚举
 *
 * @author Gmr
 * @since 2024/7/30
 */
@Getter
public enum WorkerTechnicalLevelEnum {

	INTERMEDIATE_WORKER("中级工"),
	PRIMARY("初级"),
	INTERMEDIATE("中级"),
	SENIOR("高级");

	private final String level;

	WorkerTechnicalLevelEnum(String level) {
		this.level = level;
	}

	public static void validate(String level) {
		for (WorkerTechnicalLevelEnum value : WorkerTechnicalLevelEnum.values()) {
			if (value.getLevel().equals(level)) {
				return;
			}
		}
		throw new ServiceException(ProductionProcessesException.Worker_Technical_Level_Not_Exist);
	}
}
